package com.ccit.paas.feign;


import com.ccit.paas.dto.StuDTO;
import com.ccit.paas.feign.fallback.StudentFeignFallbackService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;


/**
 *  feign接口调用示例
 *  @FeignClient注解使用说明： contextId:配置成当前类名的小写，value：微服务的名称，fallbackFactory：降级策略，兜底类
 *
 * @author: chinacoalit.com
 * @date 2024/1/9 15:47
 * @version: v1.0 初始化
 */
@FeignClient(contextId = "studentFeignService",value = "worlflow-demo-web",
    fallbackFactory = StudentFeignFallbackService.class)
public interface StudentFeignService {


    /**
     * say hello
     *
     * @author: chinacoalit.com
     * @date 2024/5/30 9:21
     * @version: v1.0 初始化
     */
    @GetMapping("/api/hello")
    String sayHello();

    /**
     * 取得学生信息列表
     *
     * @author: chinacoalit.com
     * @date 2024/5/30 9:21
     * @version: v1.0 初始化
     */
    @GetMapping("/api/list")
    List<StuDTO> getStudentList();
}
